// 根据角色动态生成路由
import { defineFakeRoute } from "vite-plugin-fake-server/client";

export default defineFakeRoute([
  {
    url: "/api/auth/login-user",
    method: "post",
    response: () => {
      return {
        avatar: "https://avatars.githubusercontent.com/u/44761321",
        username: "admin",
        nickname: "小铭",
        // 一个用户可能有多个角色
        roles: ["admin"],
        // 按钮级别权限
        permissions: ["*:*:*"],
        token: "eyJhbGciOiJIUzUxMiJ9.admin",
        refreshToken: "eyJhbGciOiJIUzUxMiJ9.adminRefresh",
        expires: 3600000000
      };
    }
  }
]);
